snippet rep "for loop up" A
for (int ${1:i} = ${2:1}; $1 <= ${3:n}; ++$1) ${4:{
  $5
}}$6
endsnippet

snippet per "for loop down" A
for (int ${1:i} = ${2:n}; $1 >= ${3:1}; --$1) ${4:{
  $5
}}$6
endsnippet

snippet lrep "for loop line" A
for (int ${1:i} = fi[${2:t}]; $1; $1 = ne[$1]) ${3:{
  $4
}}$5
endsnippet

snippet _r "read" Ai
read()
endsnippet

snippet open "freopen in and out" b
#ifndef ONLINE_JUDGE
freopen("$1.in", "r", stdin);
freopen("$1.out", "w", stdout);
#endif$2
endsnippet

snippet init "Get the template" b
typedef long long readtype;

/* Header {{{ */
#include <bits/stdc++.h>
using namespace std;

template<typename type> type beMin(type &a, type b) { return a = (a < b ? a : b); }
template<typename type> type beMax(type &a, type b) { return a = (a > b ? a : b); }

typedef long long var;

readtype read() {
  readtype a = 0, c = getchar(), s = 0;
  while (!isdigit(c)) s |= c == '-', c = getchar();
  while (isdigit(c)) a = a * 10 + c - 48, c = getchar();
  return s ? -a : a;
}
/* }}} */

int main() {
	$1
  return 0;
}
endsnippet
